package com.cy4;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class FileToArrayListUp {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("myCharStream\\array.txt"));
        ArrayList<Student> arr = new ArrayList<>();
        String line;
        while((line=br.readLine())!=null){
            String[] split = line.split(",");
            Student s = new Student();
            s.setId(split[0]);
            s.setName(split[1]);
            s.setAge(split[2]);
            s.setAddress(split[3]);
            arr.add(s);
        }
        for (Student student : arr) {
            System.out.println(student);
        }


    }
}
